package util

import (
	"time"
)

//GetDayStr 取得天间隔时间
func GetDayStr(dayDuration int) string {
	nowTime := time.Now()
	getTime := nowTime.AddDate(0, 0, dayDuration)
	restTime := getTime.Format("2006-01-02 15:04:05")
	return restTime
}

//GetDay 取得天间隔时间
func GetDay(dayDuration int) time.Time {
	nowTime := time.Now()
	getTime := nowTime.AddDate(0, 0, dayDuration)
	return getTime
}

// GetMonthStr 取得月间隔时间
func GetMonthStr(monthDuration int) string {
	nowTime := time.Now()
	getTime := nowTime.AddDate(0, monthDuration, 0)
	restTime := getTime.Format("2006-01-02 15:04:05")
	return restTime

}

//GetMonth 取得月间隔时间
func GetMonth(monthDuration int) time.Time {
	nowTime := time.Now()
	getTime := nowTime.AddDate(0, monthDuration, 0)
	return getTime
}

// GetYearStr 取得年间隔时间
func GetYearStr(yearDuration int) string {
	nowTime := time.Now()
	getTime := nowTime.AddDate(0, yearDuration, 0)
	restTime := getTime.Format("2006-01-02 15:04:05")
	return restTime

}

//GetYear 取得年间隔时间
func GetYear(yearDuration int) time.Time {
	nowTime := time.Now()
	getTime := nowTime.AddDate(0, yearDuration, 0)
	return getTime
}
